﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class FrmSearch : Form
    {
        string keywords;
        public FrmSearch(string key)
        {
            keywords = key;
            InitializeComponent();
        }
        public Form1 FrmParent { get; set; }
        private void FrmSearch_Load(object sender, EventArgs e)
        {
          

        }

        private void StartSearch_Click(object sender, EventArgs e)
        {
            List<SE> SearchList = new List<SE>();
            foreach (SE item in FrmParent.programmerList)
            {
               int i= item.ID.IndexOf(keywords);
               if (i >= 0)
               {
                   SearchList.Add(item);
               }
            }
            BindGrid(SearchList);
        }
        public void BindGrid(List<SE> list)
        {
            dgvProgrammer.DataSource = new BindingList<SE>(list);
        }
    }
}
